常用來調整動畫速度
#RStudio中用c()連結就有動畫效果,fps固定為1
#image_animate可透過fps調整動畫播放速度,以及重播次數
image_animate(image = c(pic1, pic2, pic3),
fps = 2,
#loop = 300 ,
dispose = "none")
#加入透明邊框巧妙使圖形產生位移
image_animate(image = c(pic1, pic2,image_border(pic3,"none","100X200")),
fps = 2, dispose = "none")
dispose_types()
## [1] "Undefined" "Background" "None" "Previous" "0"
## [6] "1" "2" "3"
frams為每次漸變過程,間隔的圖片張數
#BMO.light → BMO.dark → BMO.light
frames <- image_morph(c(BMO.light, image_flop(BMO.dark), BMO.light), frames = 20)
length(frames)
## [1] 43
image_info(frames) %>% head
## format width height colorspace matte filesize
## 1 PNG 720 720 sRGB TRUE 0
## 2 PNG 720 720 sRGB TRUE 0
## 3 PNG 720 720 sRGB TRUE 0
## 4 PNG 720 720 sRGB TRUE 0
## 5 PNG 720 720 sRGB TRUE 0
## 6 PNG 720 720 sRGB TRUE 0
image_append(c(frames[1],frames[11],frames[22]))
#利用image_animate調整動畫速度
BMO.morph <- image_animate(frames,fps = 10)
BMO.morph